<script setup>
import { ref } from "vue";

const List = ref([
  {
    id: 1,
    name: '发布动态',
    desc: '更新自己的小清新',
    icon: '../../static/publish/icon_1.png',
    color: '#FFF3E5',
    path: '/pages/publish/moments'
  },
  {
    id: 2,
    name: '闲置物品转卖',
    desc: '速度快，有保障',
    icon: '../../static/publish/icon_1.png',
    color: '#FFF1EE',
    path: '/pages/publish/shop'
  },
  {
    id: 3,
    name: '公益捐赠',
    desc: '为世界献爱心，为公益前行',
    icon: '../../static/publish/icon_1.png',
    color: '#FEF3DD',
    path: '/pages/publish/shop'
  },
  {
    id: 4,
    name: '发闲置',
    desc: '拍图秒发布',
    icon: '../../static/publish/icon_1.png',
    color: '#FFE60F',
    path: '/pages/publish/shop'
  },

])
const naviGateTo = path=>{
  uni.navigateTo({url:path})
}
</script>

<template>
<div class="publish">
  <div class="background animate__animated animate__fadeInDown">
    <div class="custom-shape-divider-bottom-1714915783">
      <svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none">
        <path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" class="shape-fill"></path>
        <path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5" class="shape-fill"></path>
        <path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z" class="shape-fill"></path>
      </svg>
    </div>
  </div>
  <div class="container animate__animated animate__fadeInUp">
    <div
        v-for="v in List"
        :style="{ background: v.color }"
        class="container-item"
        @click="naviGateTo(v.path)"
    >
      <div class="left">
        <image class="icon" :src="v.icon" />
        <div class="Content">
          <div class="title">{{ v.name }}</div>
          <div class="desc">{{ v.desc }}</div>
        </div>
      </div>
      <div class="right"></div>
    </div>
  </div>
</div>
</template>
<style scoped lang="scss">
.publish{
  $item-total: 4;
  $item-width: 100%;
  $item-height: 75px;
  $item-radius: 10px;
  $item-interval: 15px;
  position: relative;
  width: 100%;
  height: calc(100vh - 44px - 50px);
  .background{
    position: relative;
    width: 100%;
    height: 250px;
    background: url("../../static/publish/background.png") no-repeat;
    z-index: -1;
    background-size: 100% 100%;
    .custom-shape-divider-bottom-1714915783 {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      overflow: hidden;
      line-height: 0;
      transform: rotate(180deg);
    }
    .custom-shape-divider-bottom-1714915783 svg {
      position: relative;
      display: block;
      width: calc(100% + 1.3px);
      height: 60px;
    }
    .custom-shape-divider-bottom-1714915783 .shape-fill {
      fill: #FFFFFF;
    }

  }
  .container{
    position: absolute;
    bottom: 50px;
    width: 100%;
    padding: 0 20px 0 20px;
    height: calc($item-total * $item-height + (($item-total - 1)* $item-interval));
    .container-item{
      width: $item-width;
      height: $item-height;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px;
      border-radius: $item-radius;
      margin-bottom: $item-interval;
      .left{
        display: flex;
        height: 100%;
        .icon{
          width: 35px;
          height: 35px;
        }
        .Content{
          margin-left: 15px;
          .title{
            font-weight: bold;
            font-size: 17px;
          }
          .desc{
            font-size: 14px;
          }
        }
      }
      .right{
        width: 10px;
        height: 10px;
        transform: rotate(-45deg);
        border-bottom:  2px solid black;
        border-right:  2px solid black;
      }
    }
    .container-item:last-child{ margin-bottom: 0 }
  }
}
</style>